package com.hoshiibuy.goodsAllocation.entity.param;

import java.io.Serializable;
import java.math.BigDecimal;

import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hoshiibuy.common.query.CommonParam;
import com.hoshiibuy.goodsAllocation.entity.GoodsGenWarehouse;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * <p>
 * 查询商品总仓参数
 * </p>
 * 
 * @author Mr.Wu
 * @since 2019-04-28
 */
@Data
public class GoodsGenWarehouseQueryParam extends CommonParam implements Serializable {

	private static final long serialVersionUID = 1L;

	private Long id;

	@ApiModelProperty(value = "平台skuid")
	private String platformSkuid;

	@ApiModelProperty(value = "分仓名称")
	private String name;

	@ApiModelProperty(value = "总库存")
	private Integer stock;

	@ApiModelProperty(value = "采购价格")
	private BigDecimal purchPrice;

	@ApiModelProperty(value = "供货价格")
	private BigDecimal supplyPrice;

	@ApiModelProperty(value = "成本价格")
	private BigDecimal costPrice;

	@ApiModelProperty(value = "是否删除（0-否 1-是）")
	private Boolean isDel;

	@ApiModelProperty(value = "修改人")
	private String updatedby;

	public QueryWrapper<GoodsGenWarehouse> getQueryWrapper() {
		QueryWrapper<GoodsGenWarehouse> queryWrapper = new QueryWrapper<GoodsGenWarehouse>();
		queryWrapper.eq(this.id != null, "id", this.id);
		queryWrapper.eq(StringUtils.isNotBlank(this.platformSkuid), "platform_skuid", this.platformSkuid);
		queryWrapper.eq(StringUtils.isNotBlank(this.name), "name", this.name);
		queryWrapper.eq(this.stock != null, "stock", this.stock);
		queryWrapper.eq(this.purchPrice != null, "purch_price", this.purchPrice);
		queryWrapper.eq(this.supplyPrice != null, "supply_price", this.supplyPrice);
		queryWrapper.eq(this.costPrice != null, "cost_price", this.costPrice);
		queryWrapper.eq(this.isDel != null, "is_del", this.isDel);
		queryWrapper.eq(StringUtils.isNotBlank(this.updatedby), "updatedby", this.updatedby);
		return queryWrapper;
	}
}
